<template>
  <div class="send">
    <van-sticky>
      <van-nav-bar :title="$route.meta.title" left-arrow @click-left="onClickLeft" style="width:100%;" :border="false" />
    </van-sticky>
    <van-tabs v-model="active" color="#1BB89C" :swipeable="true" style="height:100%">
      <van-tab title="待发货">
        <WaitSend />
      </van-tab>
      <van-tab title="配送中">
        <Sending />
      </van-tab>
      <van-tab title="待收货">
        <WaitReceive />
      </van-tab>
      <!-- <van-tab title="自提/快递" v-if="utype==1">
        <Oneself />
      </van-tab> -->
      <van-tab title="所有订单">
        <AllOrder />
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
import AllOrder from '../send/AllOrder'
import WaitSend from '../send/WaitSend'
import Sending from '../send/Sending'
import WaitReceive from '../send/WaitReceive'
// import Oneself from '../send/TakeFromOneself'
export default {
  name: 'Sends',
  data () {
    return {
      active: 0,
      utype: 1,
    };
  },
  methods: {
    onClickLeft () {
      this.$router.push({ name: 'my' })
    },
    getActive () {
      this.active = this.$route.params.active * 1
    },
  },
  created () {
    this.utype = JSON.parse(localStorage.getItem("userInfo")).user.utype
    this.getActive()
  },
  components: {
    WaitSend,
    AllOrder,
    Sending,
    WaitReceive,
    // Oneself,
  }
}
</script>

<style lang="less" scoped>
.send {
  height: 100%;
  background-color: #f7f8fa;
  /deep/.van-tabs__content,
  /deep/.van-tab__pane {
    height: 100%;
  }
  /deep/ .van-tab--active {
    color: #1bb89c;
    font-weight: bold;
  }
}
</style>